import 'package:flutter/material.dart';
import 'package:flutter_deer/account/iview/bank_iview.dart';
import 'package:flutter_deer/account/models/bank_entity.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/net.dart';


class BankPagePresenter extends BasePagePresenter<BankIMvpView> {

  @override
  void initState() {

  }

  Future<dynamic> fetchList() async {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      asyncRequestNetwork<BaseEntity<List<BankEntity>>>(Method.get,
        url: HttpApi.bankCommonUseList,
        onSuccess: (data) {
          view.setCommonUserBankList(data?.data);
        },
        onError: (code,msg){

        }
      );
      asyncRequestNetwork<BaseEntity<List<BankEntity>>>(Method.get,
        url: HttpApi.bankList,
        onSuccess: (data) {
          view.setBankList(data?.data);
        },
          onError: (code,msg){

          }
      );
    });
  }

}